import {defineStore} from "pinia";
import newshop2 from "@/assets/newshop2.jpg";
import top3 from "@/assets/top3.jpg";
import top2 from "@/assets/top2.jpg";
export const group_t1Store=defineStore("group_t1Store",{
    state(){
        return {
            shopList:[
            {id:1,name:'纯皮沙发',price:2999.99,imgSrc:newshop2,message:'柔软舒适，时尚大气'},
            {id:2,name:'蚕丝被',price:888.98,imgSrc:top3,message:"天然蚕丝制作而成，简约而不简单"},
            {id:3,name:'魔方',price:16.03,imgSrc:top2,message:"有助于锻炼逻辑能力，青少年爱不释手"}
        ]
        }
    },
    actions:{
        getProductById(id:number){
            return this.shopList.find(item=>item.id===id);
        }
    }
})